/*
 * User.java
 *
 * Created on July 10, 2006, 10:16 AM
 *
 */

package org.vcboard.model;

import java.sql.Timestamp;
import org.vcboard.*;
import org.vcboard.event.*;

/**
 *
 * @author Josh VanderLinden
 */
public class User
      implements UserChangedListener
{
   private int userId = -1;
   private String username = null;
   private String password = null;
   private Timestamp start = null;
   private long period = -1;
   private long timeout = -1;
   private boolean timeoutEnabled = false;
   private int offset = 0;
   
   /** Creates a new instance of User */
   public User()
   {
      WorkTimer.addListener(this);
   }

   public int getUserId()
   {
      return userId;
   }

   public void setUserId(int userId)
   {
      this.userId = userId;
   }

   public String getUsername()
   {
      return username;
   }

   public void setUsername(String username)
   {
      this.username = username;
   }

   public String getPassword()
   {
      return password;
   }

   public void setPassword(String password)
   {
      this.password = password;
   }

   public void userChanged()
   {
   }

   public long getPeriod()
   {
      return period;
   }

   public void setPeriod(long period)
   {
      this.period = period;
   }

   public Timestamp getStart()
   {
      if (start == null)
      {
         start = new Timestamp(0);
      }
      
      return start;
   }

   public void setStart(Timestamp start)
   {
      this.start = start;
   }

   public long getTimeout()
   {
      return timeout;
   }

   public void setTimeout(long timeout)
   {
      this.timeout = timeout;
   }

   public boolean isTimeoutEnabled()
   {
      return timeoutEnabled;
   }

   public void setTimeoutEnabled(boolean timeoutEnabled)
   {
      this.timeoutEnabled = timeoutEnabled;
   }

   public int getOffset()
   {
      return offset;
   }

   public void setOffset(int offset)
   {
      this.offset = offset;
   }
}
